package com.gmail.dengtao.joe.group.interceptor;

import com.gmail.dengtao.joe.group.channel.Channel;
import com.gmail.dengtao.joe.group.member.IdleStatus;
import com.gmail.dengtao.joe.group.member.Member;

public class InterceptorAdapter implements Interceptor {

	@Override
	public void init() {
		// Empty...
	}

	@Override
	public void destroy() {
		// Empty...
	}

	@Override
	public void memberAdded(InterceptorEntity nextEntity, Channel channel, Member member) throws Exception {
		nextEntity.getInterceptor().memberAdded(nextEntity.getNextEntity(), channel, member);
	}
	
	@Override
	public void memberDisappeared(InterceptorEntity nextEntity, Channel channel, Member member) throws Exception {
		nextEntity.getInterceptor().memberDisappeared(nextEntity.getNextEntity(), channel, member);
	}

	@Override
	public void memberIdle(InterceptorEntity nextEntity, Channel channel, Member source,
			IdleStatus status) throws Exception {
		nextEntity.getInterceptor().memberIdle(nextEntity.getNextEntity(), channel, source, status);
	}

	@Override
	public void exceptionCaught(InterceptorEntity nextEntity, Channel channel, Member source,
			Throwable cause) {
		nextEntity.getInterceptor().exceptionCaught(nextEntity.getNextEntity(), channel, source, cause);
	}

	@Override
	public void dataReceived(InterceptorEntity nextEntity, Channel channel, Member sender,
			Object data) throws Exception {
		nextEntity.getInterceptor().dataReceived(nextEntity.getNextEntity(), channel, sender, data);
	}

	@Override
	public void dataSent(InterceptorEntity nextEntity, Channel channel, Member target,
			Object data) throws Exception {
		nextEntity.getInterceptor().dataSent(nextEntity.getNextEntity(), channel, target, data);
	}

	@Override
	public void dataNotSent(InterceptorEntity nextEntity, Channel channel, Member target,
			Object data) throws Exception {
		nextEntity.getInterceptor().dataNotSent(nextEntity.getNextEntity(), channel, target, data);
	}

}
